/*
day99
2019.12.5
*/
#include<stdlib.h>
#include<queue>
using namespace std;


class Node {
public:
    int val;
    vector<Node*> children;

    Node() {}

    Node(int _val) {
        val = _val;
    }

    Node(int _val, vector<Node*> _children) {
        val = _val;
        children = _children;
    }
};

class Solution {
public:
    vector<vector<int>> levelOrder(Node* root) {
    	vector<vector<int>> vec_res;
    	if(!root) return vec_res;
    	
    	
        queue<Node*> que;
        que.push(root);
        while(!que.empty())
        {
        	int time=que.size();
        	vector<int> vec;
        	for(int i=0;i<time;i++)
        	{
        		Node *tem=que.front();
        		vec.push_back(tem->val);
        		que.pop();
        		
        		int size=tem->children.size();
        		for(int j=0;j<size;j++)
        		{
        			if(tem->children[j])
					{
						que.push(tem->children[j]);
					} 
				}	
			}
			vec_res.push_back(vec);
		}
		return vec_res;
    }
};

int main()
{
	return 0;
}
